<#if cardone.StringUtils.isNotBlank(wfTaskId)>
    SELECT T.*
    FROM c1_wf_task T
    WHERE T. = :wfTaskId
<#else>
    SELECT T.* FROM (SELECT T.*
    , ROW_NUMBER() OVER(ORDER BY T.ORDER_BY_) RN
    FROM c1_wf_task T
    <#include "page.where.ftl">) T
    WHERE T.RN BETWEEN (:offset + 1) AND (:offset + :pageSize)
</#if>